namespace OFX.Aggregator.WebScraping.Infrastructure
{
	using System;

	public interface IWebBrowser
	{
		IHtmlDocument Document { get; }
		Uri Url { get; }
		WebBrowserReadyState ReadyState { get; }

		void Navigate(string url);

		event EventHandler<WebBrowserDocumentCompletedEventArgs> DocumentCompleted;
	}

	public enum WebBrowserReadyState
	{
		Uninitialized,
		Loading,
		Loaded,
		Interactive,
		Complete
	}

	public class WebBrowserDocumentCompletedEventArgs : EventArgs
	{
		// Fields
		private readonly Uri url;

		// Methods
		public WebBrowserDocumentCompletedEventArgs(Uri url) { this.url = url; }

		// Properties
		public Uri Url
		{
			get { return this.url; }
		}
	}
}